[~/src/cpp_fitnesse]% git clone http://github.com/dougbradbury/cslim.git
got f463e11c5d718a50a6986a64714342b59c566d02
walk f463e11c5d718a50a6986a64714342b59c566d02
<snip>
walk 9362f2b10fd30590a8f14c1caebf76cd2fcbe3ca
walk 4ac0cbd8d58cfe9c353142a5363bd39718f43acf
Get CppUTest
The README.txt in the root of the cslim directory just created uses CppUTest.
Extract the zip, creating a sibling directory to cslim called cpputest. The top-level directory name should be ~/src/cpp_fitnesse/cpputest
Switch to that directory and build cpputest:
[~/src/cpp_fitnesse/cpputest]% make
compiling AllTests.cpp
compiling CommandLineArgumentsTest.cpp
<snip>
compiling Utest.cpp
compiling UtestPlatform.cpp
Building archive lib/libCppUTest.a
ar: creating archive lib/libCppUTest.a
a - src/CppUTest/CommandLineArguments.o
<snip>
a - src/Platforms/Gcc/UtestPlatform.o
Linking CppUTest_tests
Running CppUTest_tests
.......!!.........................................
.............................................!....
..................................................
...!.................
OK (171 tests, 167 ran, 599 checks, 4 ignored, 0 filtered out, 10 ms)
Get FitNesse
Download fitnesse.jar, these instructions were created using the edge build #398, dated July 11, 2010, 12:49, but the release at fitnesse.org should work fine.
Move fitnesse.jar into ~src/cpp_fitnesse/
The directory should look like this before you run fitnesse for the first time:
[~/src/cpp_fitnesse]% ls
cpputest/ cslim/ fitnesse.jar
Building cslim
Go to ~/src/cpp_fitnesse/cslim
Type make:
[~/src/cpp_fitnesse/cslim]% make
compiling FixtureInCpp.cpp
<snip>
compiling TcpComLink.c
Building archive lib/libCSlim.a
ar: creating archive lib/libCSlim.a
a - src/CSlim/ListExecutor.o
<snip>
a - src/Com/TcpComLink.o
Linking CSlim_cslim
[~/src/cpp_fitnesse/cslim]%
Run FitNesse
The first time you run FitNesse, it will extract a base wiki and then start. After the first execution, it will just start. If you replace the fitnesse.jar with a new version, starting FitNesse the first time after that will update the base wiki, but leave the pages you created alone.
The first execution looks like this
[~/src/cpp_fitnesse]% java -jar fitnesse.jar -p 8080
Unpacking new version of FitNesse resources. Please be patient.
.........<snip>..........FitNesse (v20100711) Started...
port: 8080
root page: fitnesse.wiki.FileSystemPage at ./FitNesseRoot
logger: none
authenticator: fitnesse.authentication.PromiscuousAuthenticator
html page factory: fitnesse.html.HtmlPageFactory
page version expiration set to 14 days.
The directory structure after running FitNesse the first time should now look like this:
[~/src/cpp_fitnesse]% ls
FitNesseRoot/ cpputest/ cslim/ fitnesse.jar
The next time you start FitNesse, you'll simply see the following:
[~/src/cpp_fitnesse]% java -jar fitnesse.jar -p 8080
FitNesse (v20100711) Started...
port: 8080
root page: fitnesse.wiki.FileSystemPage at ./FitNesseRoot
logger: none
authenticator: fitnesse.authentication.PromiscuousAuthenticator
html page factory: fitnesse.html.HtmlPageFactory
page version expiration set to 14 days.
Create Top-Level Page
This assumes you're running FitNesse on port 8080. Update the url with your port as necessary.
If you click theTest Button, you'll see a bit of yellow. It's time to write a fixture.
Writing the Fixture
This example originated from the one provided with cslim. It's been somewhat simplified and moved closer to C++. You can review the original example in ~/src/cpp_fitnesse/cslim/fixtures/FixtureInCpp.cpp.
Go to the fixtures directory under your cslim installation (cd ~/src/cpp_fitnesse/cslim/fixtures).
Make your CSlim_cslim executable. Switch to ~/src/cpp_fixtures/cslim and type make:
[~/src/cpp_fitnesse/cslim/fixtures]% cd ..
/Users/schuchert/src/cpp_fitnesse/cslim
[~/src/cpp_fitnesse/cslim]% make
compiling Modulus.cpp
compiling Fixtures.c
Linking CSlim_cslim
Go back to your page and hit theTest button.
If you see mostly green, congratulations. As of this writing, there's an exception on the slim protocol version. Once this gets fixed, I'll update these instructions
Initial Downloads
Download cslim from github
This requires a git client.Get CppUTest
The README.txt in the root of the cslim directory just created uses CppUTest.Get FitNesse
Building cslim
Run FitNesse
The first time you run FitNesse, it will extract a base wiki and then start. After the first execution, it will just start. If you replace the fitnesse.jar with a new version, starting FitNesse the first time after that will update the base wiki, but leave the pages you created alone.[~/src/cpp_fitnesse]% java -jar fitnesse.jar -p 8080 Unpacking new version of FitNesse resources. Please be patient. .........<snip>..........FitNesse (v20100711) Started... port: 8080 root page: fitnesse.wiki.FileSystemPage at ./FitNesseRoot logger: none authenticator: fitnesse.authentication.PromiscuousAuthenticator html page factory: fitnesse.html.HtmlPageFactory page version expiration set to 14 days.[~/src/cpp_fitnesse]% java -jar fitnesse.jar -p 8080 FitNesse (v20100711) Started... port: 8080 root page: fitnesse.wiki.FileSystemPage at ./FitNesseRoot logger: none authenticator: fitnesse.authentication.PromiscuousAuthenticator html page factory: fitnesse.html.HtmlPageFactory page version expiration set to 14 days.Create Top-Level Page
This assumes you're running FitNesse on port 8080. Update the url with your port as necessary.!contents -R2 -g -p -f -h !define TEST_SYSTEM {slim} !define TEST_RUNNER {/Users/schuchert/src/cpp_fitnesse/cslim/CSlim_cslim} !define COMMAND_PATTERN {%m} !define SLIM_VERSION {0.2}- Save the page.
- Create a sub-page at the following URL: http://localhost:8080/CslimFirstExamples.DecisionTableExample
- Edit the contents. Set it to (note, to make the columns line up, use the Format button):
If you click the Test Button, you'll see a bit of yellow. It's time to write a fixture.Writing the Fixture
This example originated from the one provided with cslim. It's been somewhat simplified and moved closer to C++. You can review the original example in ~/src/cpp_fitnesse/cslim/fixtures/FixtureInCpp.cpp.If you see mostly green, congratulations. As of this writing, there's an exception on the slim protocol version. Once this gets fixed, I'll update these instructions
<--Back